/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package vista;

import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author USUARIO WINDOWS
 */
public class vistaAdministrador extends javax.swing.JFrame {

    /**
     * Creates new form vistaAdministrador
     */
    public vistaAdministrador() throws SQLException {
        initComponents();
        compras= new vistaCompras();
        venta= new vistaVentas();
        reporte= new vistaReportes();
        producto= new vistaProducto();
        cliente= new vistaCliente();
        empleado= new vistaCrupEmpleado();
        proveedor= new vistaProveedor();
        promocion= new vistaPromocion();
        
    }
    

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jMenuBar2 = new javax.swing.JMenuBar();
        jMenu3 = new javax.swing.JMenu();
        jMenuItem3 = new javax.swing.JMenuItem();
        jMAgregarProducto = new javax.swing.JMenuItem();
        jMPromocion = new javax.swing.JMenuItem();
        jMenu4 = new javax.swing.JMenu();
        jMenuItemPedido = new javax.swing.JMenuItem();
        jMProveedores = new javax.swing.JMenuItem();
        jMenu1 = new javax.swing.JMenu();
        ventas = new javax.swing.JMenuItem();
        jMClientes = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jMenuItem4 = new javax.swing.JMenuItem();
        jMenu5 = new javax.swing.JMenu();
        jMEmpleados = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setBackground(new java.awt.Color(255, 255, 255));
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N
        jLabel1.setText("MOTO LOCURA");
        getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 20, 200, 40));

        jMenu3.setText("Productos");

        jMenuItem3.setText("Inventario");
        jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem3ActionPerformed(evt);
            }
        });
        jMenu3.add(jMenuItem3);

        jMAgregarProducto.setText("Información Productos");
        jMAgregarProducto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMAgregarProductoActionPerformed(evt);
            }
        });
        jMenu3.add(jMAgregarProducto);

        jMPromocion.setText("Promociones");
        jMPromocion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMPromocionActionPerformed(evt);
            }
        });
        jMenu3.add(jMPromocion);

        jMenuBar2.add(jMenu3);

        jMenu4.setText("Proveedores");

        jMenuItemPedido.setBackground(new java.awt.Color(0, 153, 0));
        jMenuItemPedido.setForeground(new java.awt.Color(204, 0, 0));
        jMenuItemPedido.setText("Pedidos");
        jMenuItemPedido.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemPedidoActionPerformed(evt);
            }
        });
        jMenu4.add(jMenuItemPedido);

        jMProveedores.setText("Proveedores");
        jMProveedores.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMProveedoresActionPerformed(evt);
            }
        });
        jMenu4.add(jMProveedores);

        jMenuBar2.add(jMenu4);

        jMenu1.setText("Ventas");

        ventas.setText("Información ventas");
        ventas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ventasActionPerformed(evt);
            }
        });
        jMenu1.add(ventas);

        jMClientes.setText("Clientes");
        jMClientes.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMClientesActionPerformed(evt);
            }
        });
        jMenu1.add(jMClientes);

        jMenuBar2.add(jMenu1);

        jMenu2.setText("Estadística");

        jMenuItem4.setText("Reportes");
        jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem4ActionPerformed(evt);
            }
        });
        jMenu2.add(jMenuItem4);

        jMenuBar2.add(jMenu2);

        jMenu5.setText("Empleado");

        jMEmpleados.setText("Empleados");
        jMEmpleados.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMEmpleadosActionPerformed(evt);
            }
        });
        jMenu5.add(jMEmpleados);

        jMenuBar2.add(jMenu5);

        setJMenuBar(jMenuBar2);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jMenuItem3ActionPerformed

    private void jMenuItemPedidoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemPedidoActionPerformed
        // TODO add your handling code here:
       compras.setVisible(true);
                compras.setLocation(500, 200);
                compras.setIdAdmin(idAdmin);
                this.setVisible(false);
        
    }//GEN-LAST:event_jMenuItemPedidoActionPerformed

    private void ventasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ventasActionPerformed
        // TODO add your handling code here:
           venta.setVisible(true);
           venta.setLocation(500,200);
           this.setVisible(false);
        
    }//GEN-LAST:event_ventasActionPerformed

    private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem4ActionPerformed
        // TODO add your handling code here:
        reporte.setVisible(true);
           reporte.setLocation(500,200);
           this.setVisible(false);
        
    }//GEN-LAST:event_jMenuItem4ActionPerformed

    private void jMAgregarProductoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMAgregarProductoActionPerformed
        // TODO add your handling code here:

        producto.setVisible(true);
        producto.setLocation(500,200);
        this.setVisible(false);

    }//GEN-LAST:event_jMAgregarProductoActionPerformed

    private void jMProveedoresActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMProveedoresActionPerformed
        // TODO add your handling code here:
        proveedor.setVisible(true);
        proveedor.setLocation(500,200);
        this.setVisible(false);
    }//GEN-LAST:event_jMProveedoresActionPerformed

    private void jMPromocionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMPromocionActionPerformed
        // TODO add your handling code here:
         promocion.setVisible(true);
        promocion.setLocation(500,200);
        this.setVisible(false);
    }//GEN-LAST:event_jMPromocionActionPerformed

    private void jMClientesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMClientesActionPerformed
        // TODO add your handling code here:
        cliente.setVisible(true);
           cliente.setLocation(500,200);
           this.setVisible(false);
        
    }//GEN-LAST:event_jMClientesActionPerformed

    private void jMEmpleadosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMEmpleadosActionPerformed
        // TODO add your handling code here:
        empleado.setVisible(true);
        empleado.setLocation(500,200);
        this.setVisible(false);
    }//GEN-LAST:event_jMEmpleadosActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(vistaAdministrador.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(vistaAdministrador.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(vistaAdministrador.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(vistaAdministrador.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                try {
                    new vistaAdministrador().setVisible(true);
                } catch (SQLException ex) {
                    Logger.getLogger(vistaAdministrador.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    private javax.swing.JMenuItem jMAgregarProducto;
    private javax.swing.JMenuItem jMClientes;
    private javax.swing.JMenuItem jMEmpleados;
    private javax.swing.JMenuItem jMPromocion;
    private javax.swing.JMenuItem jMProveedores;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenu jMenu4;
    private javax.swing.JMenu jMenu5;
    private javax.swing.JMenuBar jMenuBar2;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JMenuItem jMenuItemPedido;
    private javax.swing.JMenuItem ventas;
    // End of variables declaration//GEN-END:variables
private vistaCompras compras;
private vistaVentas venta;
private vistaReportes reporte;
private vistaProducto producto; 
private vistaCliente cliente;
private vistaPromocion promocion;
private vistaCrupEmpleado empleado;
private vistaProveedor proveedor;
private int idAdmin;

    public int getIdAdmin() {
        return idAdmin;
    }

    public void setIdAdmin(int idAdmin) {
        this.idAdmin = idAdmin;
    }
}
